package cn.group.hotel2.controller;

import cn.group.hotel2.pojo.dto.ReplyAddNewDTO;
import cn.group.hotel2.service.IReplyService;
import cn.group.hotel2.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 处理回复数据相关的控制器
 *
 * @author wcl
 * @version 0.0.1
 * @date 2022/12/1
 */
@Slf4j
@RestController
@RequestMapping("/reply")
@Api(tags = "08 回复管理模块")
public class ReplyController {

    @Autowired
    private IReplyService replyService;

    public ReplyController() {
        log.debug("创建控制器对象:ReplyController");
    }

    @PostMapping("/add-new")
    @ApiOperation("添加回复")
    @ApiOperationSupport(order = 100)
    public JsonResult<Void> addNew(@Validated ReplyAddNewDTO replyAddNewDTO) {
        log.debug("开始处理【添加回复】的请求，参数：{}", replyAddNewDTO);
        replyService.addNew(replyAddNewDTO);
        return JsonResult.ok();
    }

}
